home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
oop_tp55.zip
/
LIST3_4.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-03-08
|
1KB
|
53 lines
program Listing3_4;
uses Tags, Crt, NewTags;
var
LT100,
FT100 : Analog;
PSL100 : LoSwitch;
PSH100 : HiSwitch;
EY100 : NewPump;
time : integer;
{ The following function will be used by the NewPump object.
Since it is used with a procedural variable, far calls
must be forced for compilation. }
{$F+}
function SystemPressure : real;
begin
SystemPressure := HtToPSI(LT100.GetValue);
end;
{$F-}
begin
LT100.Init( 'LT100', 512, 50, 250 );
FT100.Init( 'FT100', 2048, 0, 10000 );
PSL100.Init( 'PSL100', 60, SystemPressure );
PSH100.Init( 'PSH100', 75, SystemPressure );
EY100.Init( 'EY100', off, 100, 4.8e-7, @SystemPressure);
time := 0;
repeat
Inc( time ); { increment the time }
LT100.PutValue( LT100.GetValue - FlowToDeltaHt(FT100.GetValue) );
PSL100.PutReading( SystemPressure );
PSH100.PutReading( SystemPressure );
if Quiet.IsOff then
writeln( f, 'Level is ', LT100.GetValue:2:2, ' ft at minute ', time);
if PSL100.GetStatus = on then
EY100.PutStatus( ON );
if PSH100.GetStatus = on then
EY100.PutStatus( OFF );
LT100.PutValue( LT100.GetValue + FlowToDeltaHt( EY100.Flow ));
until KeyPressed;
Quiet.On;
end.